package gitee.cheungming.modules.governance.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import gitee.cheungming.common.service.impl.CrudServiceImpl;
import gitee.cheungming.modules.governance.dao.VehicleDao;
import gitee.cheungming.modules.governance.dto.VehicleDTO;
import gitee.cheungming.modules.governance.entity.VehicleEntity;
import gitee.cheungming.modules.governance.service.VehicleService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 车辆
 *
 * @author cheungming cheungming@gmail.com
 * @since 1.0.0 2025-08-21
 */
@Service
public class VehicleServiceImpl extends CrudServiceImpl<VehicleDao, VehicleEntity, VehicleDTO> implements VehicleService {

    @Override
    public QueryWrapper<VehicleEntity> getWrapper(Map<String, Object> params) {
        String id = (String) params.get("id");

        QueryWrapper<VehicleEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }
}